﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Payment.aspx.cs" Inherits="User_Payment" MasterPageFile="~/Site.master" %>

<asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent">

    
     <asp:HyperLink ID="UserLink" runat="server" NavigateUrl="UserPanel.aspx">Панель пользователя</asp:HyperLink>
&nbsp;<span class="Apple-style-span" 
        style="color: rgb(105, 105, 105); font-family: 'Helvetica Neue', 'Lucida Grande', 'Segoe UI', Arial, Helvetica, Verdana, sans-serif; font-size: 13px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255); display: inline !important; float: none; ">→&nbsp; </span> 
    <asp:Label ID="UserLabel" runat="server" Text="Оплата" ForeColor="black"></asp:Label><br/>

    <br />
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" 
        DataSourceID="SqlDataSourceContract" 
        onrowdatabound="GridView1_RowDataBound">
        <Columns>
            <asp:BoundField DataField="Кредит" HeaderText="Кредит" 
                SortExpression="Кредит" />
            <asp:BoundField DataField="Сумма" HeaderText="Сумма" SortExpression="Сумма" />
            <asp:BoundField DataField="Срок" HeaderText="Срок" SortExpression="Срок" />
            <asp:BoundField DataField="Валюта" HeaderText="Валюта" 
                SortExpression="Валюта" />
            <asp:BoundField HeaderText="Оплачено по процентам" />
            <asp:BoundField HeaderText="Оплачено по основному долгу" />
            <asp:BoundField HeaderText="Всего оплачено" />
        </Columns>
    </asp:GridView>
    <asp:SqlDataSource ID="SqlDataSourceContract" runat="server" 
        ConnectionString="<%$ ConnectionStrings:BankDBConnectionString %>" 
        SelectCommand="SELECT Credit.Name AS Кредит, Contract.Amount AS Сумма, Contract.TermLength AS Срок, Currency.Name AS Валюта FROM Contract INNER JOIN Credit ON Contract.CreditId = Credit.CreditID INNER JOIN Currency ON Contract.CurrencyId = Currency.CurrencyID WHERE (Contract.ContractId = @ContractId)">
        <SelectParameters>
            <asp:SessionParameter Name="ContractId" SessionField="contractId" />
        </SelectParameters>
    </asp:SqlDataSource>
    <br />
    <asp:Label ID="AmountLabel" runat="server" Text=""></asp:Label>
    <asp:TextBox ID="Amount" runat="server" Enabled="true" Text="0"></asp:TextBox>
    <br />
    <asp:Button ID="PayButton" runat="server" Text="Оплатить" 
        onclick="PayButton_Click" />
        <asp:Label ID="ErrorLabel" runat="server" Text=""></asp:Label>

</asp:Content>